package com.diaohw.module.system.obj.mapstruct;

import com.diaohw.module.system.obj.dto.DepartmentDto;
import com.diaohw.module.system.obj.entity.Department;
import com.diaohw.module.system.obj.vo.DepartmentTreeVo;
import com.diaohw.module.system.obj.vo.DepartmentVo;
import com.diaohw.platform.remote.auth.obj.bo.DepartmentBO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 部门 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-07-05
 */
@Mapper
public interface DepartmentMapstruct {

    DepartmentMapstruct INSTANCE = Mappers.getMapper(DepartmentMapstruct.class);

    /**
     * dto to entity
     */
    Department dtoToEntity(DepartmentDto dto);

    /**
     * entity to dto
     */
    DepartmentDto entityToDto(Department entity);

    /**
     * entity to vo
     */
    DepartmentVo entityToVo(Department entity);
    DepartmentBO entityToBo(Department entity);

    @IterableMapping(elementTargetType = DepartmentTreeVo.class)
    List<DepartmentVo> entityToVo(List<Department> list);


    /**
     * entity to vo
     */
    DepartmentTreeVo entityToTreeVo(Department entity);
}

